touchy: fit the window to the monitor#4131
Conversation
|
Fonts render too small, will push update soon |
12bd886 to
3a31a9b
Compare
|
I reworked this from the earlier scroll/scale version. The key change is wrapping each notebook page so the window sizes to the visible page instead of the widest hidden one (Preferences); that also fixes the window growing after I am open to changes on any of this, the dialog wording, whether to hide the handwheel on Preferences, the readability floor, etc. I have screenshots at the resolutions above if useful. |
Changing to hovering infobar to avoid slapping anyone on the face @BsAtHome
|
3a31a9b to
59e3f19
Compare
|
Looks good 👍 , only the minimize/maximize icon in the title bar disappeared so you cannot use it windowed anymore. With the replacement of the deprecated table in the status (see #4135), the scrollbar isn't really needed, but let's keep it just in case :) |
59e3f19 to
a705e7f
Compare
|
Marking this a draft for now: per the plan in #4135 it should land after the GTK3 conversion (#4135), so I will rebase this onto #4135 once that merges. It applies to master and works standalone in the meantime. On the screenshots where the window has no title bar: that is only because the tests run under Xvfb with no window manager. On a normal desktop touchy keeps its title bar with minimize, maximize and close as usual, and close still fires the existing quit handler. This PR does not change that (and it now sets no max-size hint, so the maximize button is never affected either). |
|
Try with the last commit |
|
The icon is there but I cannot resize the window smaller than the size it got when started maximized (=screen size) even though I get the handle. touchy-resize.mp4 |
|
Fixed in the latest commit. The scroller had its min-content pinned to the work area, which forced the window minimum to screen size. Now only the max is bounded, so it resizes smaller freely. Also added drag-to-pan on each page (finger or mouse) since touchy is a touchscreen UI. |
|
Rescaling works now 👍 I can even scale it smaller than the space the widgets need. Not sure if that is good or bad :D touchy-rescaling.mp4 |
|
Well, following the mailing list, the window forcing its size would have the UI pop out of the monitor, and the user had to fight it, this PR solves the issue at the core, at most there is some stuff you don't see, and you have to scroll to get to it, and you can make font a bit smaller to fit, automatic resizing overlay helper also finds the fitting font size for you. No more fighting to fit, the window can be as small as the user needs it to be. I did not force a minimum size as system tray bars and window top bar can remove some unspecified amount of space system to system, we could force a minimum to view everything without scrolling, but I'm not sure that's necessarily what the user is looking for, I think flexibility solves the issue completely at the source, IMO there is no real user downside with being able to make the window extremely small. |
Touchy has no scrolling, so when content is larger than the display the
window grows past the screen edge and controls become unreachable. The
worst offender is structural: a GtkNotebook sizes to its largest page,
so the small visible page (the buttons) was forced as wide as the hidden
Preferences page, and the tall tool-table listing grew the window on
reload.
- Wrap each notebook page in a scroller, so the notebook sizes to the
current page and oversized pages (Preferences, a long tool table)
scroll instead of growing the window. This alone keeps the height in
check and cuts the width from 1346 to 1094 px.
- Wrap the whole window in a scroller and bound it to the monitor work
area, so it can never exceed the screen.
- Hide the handwheel column on the Preferences tab (you are not jogging
there) so the wide settings page gets the full width.
- When the content still does not fit a narrow screen, float a
non-modal info bar over the content offering to shrink the fonts:
Shrink to fit and save / Not now / Never ask again. Accepting scales
to the largest fitting size, rounds to whole points, saves them, and
updates the pickers to match. It is only shown when it does not fit
and never repeated once it fits; Not now is remembered per screen
size (fit_skip_size) so it is not offered again until the screen
changes, and Never ask again (fit_fonts) disables it entirely.
- Add an 'Offer to shrink fonts to fit the screen' checkbox to
Preferences / Display Options to re-enable the offer after Never ask
again, and document the behaviour.
- Window is now resizable smaller than screen (scroller max-content bounds the top end; min stays 0). - Startup tab restored correctly after page-wrapping loop shifted it. - Each page scroller accepts drag-to-pan (finger or mouse, 8px threshold so button taps are unaffected). - Fix pre-existing TypeError in listing.on_select: button_release_event passes (widget, event) but signature accepted only one argument.
b5037e2 to
2c61f67
Compare




Touchy's window could grow past the screen edge, worse after loading a large tool table, putting controls out of reach. The root cause is structural: a GtkNotebook sizes to its largest page, so the small visible page was forced as wide as the hidden Preferences page.
What this does:
Shrink to fit and save/Not now/Never ask again. It never asks when it already fits and never repeats once it fits;Not nowis remembered per screen size, and a Preferences checkbox re-enables the offer afterNever ask again.Tested with the ui-smoke touchy tests and by hand at 1920x1080, 1366x768, 1280x1024, 1280x720, 1024x768 and 800x600 (all tabs, plus reload tool table).